package com.yimils.core.common.dto;



import java.util.LinkedHashMap;

@SuppressWarnings("unchecked")
public class RspBase extends LinkedHashMap<String ,Object> {

    public RspBase() {
        put("code", SysCode.OPT_OK);
        put("msg", "");
    }

    public static RspBase OK() {
        return new RspBase();
    }

    public static RspBase OK(String msg) {
        RspBase rspBase = OK();
        rspBase.put("msg", msg);
        return rspBase;
    }

    public static RspBase CODE(Integer code) {
        RspBase rspBase = OK();
        rspBase.put("code", code);
        return rspBase;
    }

    public static RspBase ERROR(Integer code, String msg) {
        RspBase rspBase = OK(msg);
        rspBase.put("code", code);
        return rspBase;
    }

}
